﻿using System;
using System.Drawing;
using System.Drawing.Drawing2D;

namespace Imager
{
    public class ComponentOfImage
    {
        public Rectangle border;
        public bool Resizeble = true;

        public virtual void Draw(Graphics gr)
        {
        }

        protected static Pen pen = new Pen(Color.Red, 1);
        protected static Pen solidpen = new Pen(Color.Red, 1);
        protected static Brush whitebrush = new SolidBrush(Color.White);

        public virtual void DrawBorder(Graphics gr)
        {
            pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
            gr.DrawRectangle(pen, border);
        }

        public virtual void Move(int x1, int x2)
        {
            border.X = x1;
            border.Y = x2;
        }

        public virtual bool IsInsidePoint(int x, int y)
        {
            if (border.X <= x && border.X + border.Width > x &&
                border.Y <= y && border.Y + border.Height > y)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
    }
}